home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 January: Mac OS SDK / Dev.CD Jan 00 SDK2.toast / Development Kits / Hardware / PC Card SDKs / PC Card Manager 2.0 SDK / Software / PC Card Sample / ClientFramework / PCCardClient.h < prev   
Encoding:
C/C++ Source or Header  |  1997-06-05  |  2.8 KB  |  113 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        PCCardClient.h
  3.  
  4.     Contains:    Definitions and constants for the PC Card Sample Client
  5.  
  6.     Written by:    Dave Falkenburg with lots of helpful code from:
  7.                     Phillip Nguyen, Greg Brewer, timothy warden,
  8.                     James Blair, and Richard W. Mincher.
  9.  
  10.     Copyright © 1995 by Apple Computer, Inc., all rights reserved.
  11.  
  12.     Change History (most recent first):
  13.  
  14.          <0>     11/28/95    DRF        first code.
  15. */
  16.  
  17. #ifndef    _APPLE_PCCARDCLIENT_
  18. #define    _APPLE_PCCARDCLIENT_
  19.  
  20. //    PCCardClient.h
  21.  
  22. #ifndef        __CARDSERVICES__
  23. #include    <CardServices.h>
  24. #endif
  25.  
  26. #ifndef        __CARDSERVICES__
  27. #include    <Icons.h>
  28. #endif
  29.  
  30.  
  31. #ifndef    DEBUG
  32. #define    DEBUG    1
  33. #endif
  34.  
  35. #if        DEBUG
  36. #define    IfDebugStr(x)    DebugStr(x)
  37. #else
  38. #define    IfDebugStr(x)
  39. #endif
  40.  
  41.  
  42. //    Resource IDs used by the PC Card Driver “framework”
  43.  
  44. enum
  45.     {
  46.     kCardIconID                    = 128,
  47.     kExtensionIconID            = 129,
  48.     kExtensionNotLoadedIconID    = 130,
  49.     
  50.     kCardStringList                = 128,
  51.         kCardName         = 1,
  52.         kCardType        = 2,
  53.         kCardHelpString = 3,
  54.         kCardVendorName = 4,
  55.         kCardClientName = 5
  56.     };
  57.  
  58.  
  59. //    per-socket globals which you must define in "CardSpecific.h"
  60.  
  61. typedef    struct    PCCardPerSocketState    PCCardPerSocketState;
  62.  
  63. enum
  64.     {
  65.     kCardIsConfigured    =    (1 << 0)
  66.     };
  67.  
  68.  
  69. #include "CardSpecific.h"
  70.  
  71.  
  72. typedef    struct    PCCardClientGlobalsRec
  73.     {
  74.     UInt32                    clientHandle;
  75.     Str255                    cardName;
  76.     Str255                    cardType;
  77.     Str255                    vendorName;
  78.     Str255                    clientName;
  79.     Str255                    helpString;
  80.     Handle                    cardIconSuite;
  81.     UInt32                    numberOfSockets;
  82.     PCCardPerSocketState    socketState[1];
  83.     }    PCCardClientGlobalsRec;
  84.  
  85.  
  86. //    PC Card Client “framework” functions
  87.  
  88. void            main(void);
  89.  
  90. Boolean            PCCardManagerIsAvailable(UInt32 * numberOfSockets);
  91.  
  92. OSErr            InstallPCCardClient(UInt32 numberOfSockets);
  93.  
  94. pascal OSErr    HandlePCCardEvent(ClientCallbackPBPtr pb);
  95.  
  96. OSErr            HandleCardRemoval(PCCardClientGlobalsRec * globals,PCCardPerSocketState * socketState, ClientCallbackPBPtr pb);
  97. OSErr            HandleCardEjectRequest(PCCardClientGlobalsRec * globals,PCCardPerSocketState * socketState, ClientCallbackPBPtr pb);
  98. OSErr            HandleCardReady(PCCardClientGlobalsRec * globals,PCCardPerSocketState * socketState, ClientCallbackPBPtr pb);
  99. OSErr            HandleGetClientInfo(PCCardClientGlobalsRec * globals, GetClientInfoPB *pb);
  100. OSErr            HandleCardSuspend(PCCardClientGlobalsRec * globals, ClientCallbackPBPtr pb);
  101. OSErr            HandleCardResume(PCCardClientGlobalsRec * globals, ClientCallbackPBPtr pb);
  102.  
  103.  
  104. //    Card-specific functions you need to supply for your card
  105.  
  106. extern Boolean    IsThisMyCard(PCCardClientGlobalsRec * globals,UInt16 socket);
  107. extern OSErr    ConfigureMyCard(PCCardClientGlobalsRec * globals,PCCardPerSocketState * socketState,UInt16 socket);
  108. extern OSErr    UnconfigureMyCard(PCCardClientGlobalsRec * globals,PCCardPerSocketState * socketState,UInt16 socket);
  109. extern void        MyCardInterruptHandler(PCCardClientGlobalsRec * globals,PCCardPerSocketState * socketState,UInt16 socket);
  110.  
  111.  
  112. #endif
  113.